home *** CD-ROM | disk | FTP | other *** search
/ Sky at Night 2007 June / SAN CD 6-2007 CD-ROM 25.iso / pc / Software / AstroGrav_Win / Java / jre1.6.0 / lib / rt.jar / sun / swing / FilePane$1FilePaneAction.class (.txt) < prev    next >
Encoding:
Java Class File  |  2006-11-29  |  1.6 KB  |  52 lines

  1. package sun.swing;
  2.  
  3. import java.awt.event.ActionEvent;
  4. import javax.swing.AbstractAction;
  5. import javax.swing.JFileChooser;
  6.  
  7. class FilePane$1FilePaneAction extends AbstractAction {
  8.    // $FF: synthetic field
  9.    final FilePane this$0;
  10.  
  11.    FilePane$1FilePaneAction(FilePane var1, String var2) {
  12.       this(var1, var2, var2);
  13.    }
  14.  
  15.    FilePane$1FilePaneAction(FilePane var1, String var2, String var3) {
  16.       super(var2);
  17.       this.this$0 = var1;
  18.       this.putValue("ActionCommandKey", var3);
  19.    }
  20.  
  21.    public void actionPerformed(ActionEvent var1) {
  22.       String var2 = (String)this.getValue("ActionCommandKey");
  23.       if (var2 == "cancelSelection") {
  24.          if (this.this$0.editFile != null) {
  25.             FilePane.access$200(this.this$0);
  26.          } else {
  27.             this.this$0.getFileChooser().cancelSelection();
  28.          }
  29.       } else if (var2 == "editFileName") {
  30.          JFileChooser var3 = this.this$0.getFileChooser();
  31.          int var4 = FilePane.access$300(this.this$0).getMinSelectionIndex();
  32.          if (var4 >= 0 && this.this$0.editFile == null && (!var3.isMultiSelectionEnabled() || var3.getSelectedFiles().length <= 1)) {
  33.             FilePane.access$400(this.this$0, var4);
  34.          }
  35.       } else if (var2 == "refresh") {
  36.          this.this$0.getFileChooser().rescanCurrentDirectory();
  37.       }
  38.  
  39.    }
  40.  
  41.    public boolean isEnabled() {
  42.       String var1 = (String)this.getValue("ActionCommandKey");
  43.       if (var1 == "cancelSelection") {
  44.          return this.this$0.getFileChooser().isEnabled();
  45.       } else if (var1 != "editFileName") {
  46.          return true;
  47.       } else {
  48.          return !FilePane.access$500(this.this$0) && this.this$0.getFileChooser().isEnabled();
  49.       }
  50.    }
  51. }
  52.